package com.fegin.bean.admin;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 公司新闻
 * </p>
 *
 * @author 卫星
 * @since 2019-03-04
 */
public class ContentNews implements Serializable {

    private static final long serialVersionUID = 1L;

    private Long id;
    /**
     * 用户id
     */
    @TableField("user_id")
    private Long userId;

    /**
     * 新闻标题
     */
    @TableField("title")
    private String title;

    /**
     * 封面图
     */
    @TableField("img_cover")
    private String imgCover;

    /**
     * 新闻来源
     */
    @TableField("source")
    private String source;

    /**
     * 新闻内容
     */
    @TableField("details")
    private String details;

    /**
     * 新闻类型 默认为0 方便以后扩展
     */
    @TableField("content_type")
    private Integer contentType;

    /**
     * 是否展示 默认为1 展示
     */
    @TableField("is_show")
    private Boolean isShow;

    /**
     * 是否置顶 默认为0 不置顶（推荐）
     */
    @TableField("is_top")
    private Boolean isTop;

    /**
     * 创建时间
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("create_time")
    private Date createTime;

    /**
     * 1:删除，0:未删除
     */
    @TableField("is_deleted")
    private Boolean isDeleted;

    @TableField("timestamp")
    private Date timestamp;


    /**
     * 订单开始日期、结束日期
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(exist = false)
    private Date startDate, endDate;

    public Boolean getShow() {
        return isShow;
    }

    public void setShow(Boolean show) {
        isShow = show;
    }

    public Boolean getTop() {
        return isTop;
    }

    public void setTop(Boolean top) {
        isTop = top;
    }

    public Boolean getDeleted() {
        return isDeleted;
    }

    public void setDeleted(Boolean deleted) {
        isDeleted = deleted;
    }

    public Date getStartDate() {
        return startDate;
    }

    public void setStartDate(Date startDate) {
        this.startDate = startDate;
    }

    public Date getEndDate() {
        return endDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getImgCover() {
        return imgCover;
    }

    public void setImgCover(String imgCover) {
        this.imgCover = imgCover;
    }

    public String getSource() {
        return source;
    }

    public void setSource(String source) {
        this.source = source;
    }

    public String getDetails() {
        return details;
    }

    public void setDetails(String details) {
        this.details = details;
    }

    public Integer getContentType() {
        return contentType;
    }

    public void setContentType(Integer contentType) {
        this.contentType = contentType;
    }

    public Boolean getIsShow() {
        return isShow;
    }

    public void setIsShow(Boolean show) {
        isShow = show;
    }

    public Boolean getIsTop() {
        return isTop;
    }

    public void setIsTop(Boolean isTop) {
        this.isTop = isTop;
    }

    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Boolean getIsDeleted() {
        return isDeleted;
    }

    public void setIsDeleted(Boolean isDeleted) {
        this.isDeleted = isDeleted;
    }

    public Date getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(Date timestamp) {
        this.timestamp = timestamp;
    }

    @Override
    public String toString() {
        return "ContentNews{" +
                "userId=" + userId +
                ", title=" + title +
                ", imgCover=" + imgCover +
                ", source=" + source +
                ", details=" + details +
                ", contentType=" + contentType +
                ", isShow=" + isShow +
                ", isTop=" + isTop +
                ", createTime=" + createTime +
                ", isDeleted=" + isDeleted +
                ", timestamp=" + timestamp +
                "}";
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }
}
